/**
 * 
 */
package com.brother.goallife.dto;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Enumerated;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.brother.goallife.AbstractGoallifeEntity;
import com.brother.goallife.type.AccountStatusType;

/**
 * @author anhtuan_truong
 * 
 */
@Entity
@Table(name = "T_ACCOUNT_STATUS")
public class AccountStatus extends AbstractGoallifeEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3115893871988599853L;
	private Account account;
	private AccountStatusType status;
	private Date validFrom;
	private Date validTo;

	// Mapping unidirectionally
	@ManyToOne(targetEntity = Account.class)
	@JoinColumn(name = "ACCOUNT", nullable = false)
	public Account getAccount() {
		return account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}

	@Column(name = "STATUS", nullable = false, length = 5)
	@Enumerated
	public AccountStatusType getStatus() {
		return status;
	}

	public void setStatus(AccountStatusType status) {
		this.status = status;
	}

	@Column(name = "VALID_FROM", nullable = false)
	@Temporal(TemporalType.DATE)
	public Date getValidFrom() {
		return validFrom;
	}

	public void setValidFrom(Date validFrom) {
		this.validFrom = validFrom;
	}

	@Column(name = "VALID_TO")
	@Temporal(TemporalType.DATE)
	public Date getValidTo() {
		return validTo;
	}

	public void setValidTo(Date validTo) {
		this.validTo = validTo;
	}

}
